<meta charset="utf-8">
<?php
require_once("tools.php");

$con = new con_db();

$sql = "UPDATE Persons SET bkc = '$_COOKIE[bkgcolor]' 
        WHERE zhanghao = '$_COOKIE[user]'";
$con->query($sql);

setcookie("bkgcolordone", $_COOKIE['bkgcolor'], time() + 3600);

echo "<script>alert('背景颜色保存成功');window.location.href='homepage.php';</script>";
?>
